package db

import (
	"fmt"
	"github.com/gomodule/redigo/redis"
	"github.com/spf13/viper"
	"time"
)

var R redis.Conn

func RedisInit() {

	var err error

	address := viper.GetString("Redis.Address") + ":" + viper.GetString("Redis.Port")

	R, err = redis.Dial("tcp", address)
	redis.DialConnectTimeout(60 * time.Second)
	if err != nil {
		fmt.Println(err.Error())
	}

}
